package queryid

import (
	"errors"
	"gitee.com/hlwqds/clientSimulation/src/lib/myjson"
	"github.com/tidwall/gjson"
)

//if we find the cus, we send the id back, else we should change the ivr flow
func (p *ReqPriD) handleKeyBackQuery(req []byte) (rsp []byte, err error) {
	usrQueryID := gjson.GetBytes(req, myjson.GenPathForGJSON(jsonKeyRequest, jsonKeyUserQueryID))
	switch usrQueryID.Int() {
	case 3:
		rsp, err = p.handleKeyBack()
	default:
		err = errors.New("Unkown id")
	}

	return rsp, err
}
